using System;
using MotionFramework.MVC;

public class GameFacade : Facade
{
    /// <summary>
    /// Facade Singleton Factory method
    /// </summary>
    /// <returns>the Singleton instance of the Facade</returns>
    public static IFacade Instance => instance ?? (instance = Activator.CreateInstance<GameFacade>());

    protected override void InitializeController()
    {
        base.InitializeController();
        
        RegisterCommand<UpdaterCommand>(nameof(UpdaterCommand));
        RegisterCommand<UpdaterDoneCommand>(nameof(UpdaterDoneCommand));
    }

    /// <summary>
    /// 游戏启动器
    /// </summary>
    public void Launcher()
    {
#if UNITY_EDITOR
        // 编辑不走热更新逻辑
        SendNotification(nameof(UpdaterDoneCommand));
#else
        // 非编辑走热更新逻辑
        SendNotification(nameof(UpdaterCommand));
#endif
    }
}
